#include <bits/stdc++.h>

using namespace std;
const int maxn=510,INF=0x3f3f3f3f;
struct Station
{
    double price,dis;
} stations[maxn];
bool cmp(Station a,Station b)
{
    return a.dis<b.dis;
}
int main_1033()
{
    int N;
    double Cmax,D,Davg;
    scanf("%lf%lf%lf%d",&Cmax,&D,&Davg,&N);
    for (int i=0; i<N ; ++i )
    {
        scanf("%lf%lf",&stations[i].price,&stations[i].dis);
    }
    stations[N].price=0,stations[N].dis=D;
    sort(stations,stations+N,cmp);
    if (stations[0].dis!=0)
    {
        printf("The maximum travel distance = 0.00\n");
    }
    else
    {
        int now=0;
        double cost=0,nowTank=0,MAX=Cmax*Davg;
        while (now<N)
        {
            int k=-1;
            double priceMin=INF;
            for (int i=now+1; i<=N&&(stations[i].dis-stations[now].dis)<=MAX ; ++i )
            {
                if (stations[i].price<priceMin)
                {
                    priceMin=stations[i].price;
                    k=i;
                    if (priceMin<stations[now].price)
                    {
                        break;
                    }
                }
            }
            if (k==-1)
            {
                break;
            }
            double need=(stations[k].dis-stations[now].dis)/Davg;
            if (priceMin<stations[now].price)
            {
                if (nowTank<need)
                {
                    cost+=(need-nowTank)*stations[now].price;
                    nowTank=0;
                }
                else
                {
                    nowTank-=need;
                }
            }
            else
            {
                cost+=(Cmax-nowTank)*stations[now].price;
                nowTank=Cmax-need;
            }
            now=k;
        }
        if (now==N)
        {
            printf("%.2f\n",cost);
        }
        else
        {
            printf("The maximum travel distance = %.2f",stations[now].dis+MAX);
        }
    }
    return 0;
}
